const {
  $util,
} = getApp();
Page({
  /**
    * 页面的初始数据
    */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.setData(options);
    this.loadDetail();
  },
  loadDetail() {
    $util.request({
      url: 'entry/wxapp/edu.affairs.details',
      data: {
        id: this.data.id,
      },
      success: (res) => {
        this.setData(res.list);
        // res.list && res.list.title && wx.setNavigationBarTitle({
        //   title: res.list.title,
        // });
        wx.setNavigationBarTitle({
          title: '党务知识',
        })
      },
    });
  },
  onShareAppMessage() {
    let _this = this;
    let path = '/ws_party_const/pages/education/routine/detail?id' + _this.data.id;
    let res = {
      path,
    };
    return res;
  },
});
